﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master"
    Inherits="System.Web.Mvc.ViewPage<MShop.Core.Domain.Trade>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    文章管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="fullBox">
        <div id="formOutBox">
            <div id="formTitle">
                <div class="formTitleCard_c"  id="Header1">
                    订单管理</div>
                <div class="formTitleCard"  id="Header2">
                    商品列表</div>
                <div class="formTitlRight">
                    <img src="/Content/back.png" width="16" height="16" border="0" align="middle" style="margin-right: 3px;" />
                    <%: Html.ActionLink("返回", "Index") %>
                </div>
            </div>
            <div id="formBox">
                <% Html.EnableClientValidation(); %>
                <% using (Html.BeginForm())
                   {%>
                <%: Html.ValidationSummary(true) %>
                <table width="100%" border="0"  id="Content1"  cellspacing="0" cellpadding="3" class="formTable">
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.TradeId)%>
                        </td>
                        <td>
                            <%=Model.TradeId %>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.UserId) %>
                        </td>
                        <td>
                            <%=Model.ShopUsers.FullName%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.DistributionId) %>
                        </td>
                        <td>
                            <%: Model.Distribution.Name%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.PayId) %>
                        </td>
                        <td>
                            <%: Model.Pay.PayName%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Payment) %>
                        </td>
                        <td>
                            <%:Model.Payment%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.PayTime)%>
                        </td>
                        <td>
                            <%:Model.PayTime%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Created)%>
                        </td>
                        <td>
                            <%:Model.Created%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.BuyerMemo)%>
                        </td>
                        <td>
                            <%:Model.BuyerMemo%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.SellerMemo)%>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.SellerMemo)%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.HasInvoice)%>
                        </td>
                        <td>
                            <%:Model.HasInvoice?"有":"无"%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Modified)%>
                        </td>
                        <td>
                            <%:Model.Modified%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.EndTime)%>
                        </td>
                        <td>
                            <%:Model.EndTime%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.InvoiceName)%>
                        </td>
                        <td>
                               <%:Model.InvoiceName%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.TradeStatus)%>
                        </td>
                        <td>
                           <%=Html.DropDownList("TradeStatus", ViewData["status"] as IEnumerable<SelectListItem>)%>                        
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Location)%>
                        </td>
                        <td>
                          <%:Model.Location%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.ReceiverName)%>
                        </td>
                        <td>
                             <%:Model.ReceiverName%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Tel)%>
                        </td>
                        <td> <%:Model.Tel%>                           
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.Mobile)%>
                        </td>
                        <td>
                           <%:Model.Mobile%>          
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.PostCode)%>
                        </td>
                        <td>
                            <%:Model.PostCode%>       
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.AreaId)%>
                        </td>
                        <td>
                            <%:Model.AreaGroup.CurrentAreaName%>       
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.PostFee)%>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.PostFee)%>
                            <%: Html.ValidationMessageFor(model => model.PostFee)%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                            <%: Html.LabelFor(model => model.TotalFee)%>
                        </td>
                        <td>
                            <%:Model.TotalFee%>      
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                       <tr>
                        <td width="80">
                            <%: Html.LabelFor(model => model.DisCount)%>
                        </td>
                        <td>
                            <%: Html.EditorFor(model => model.DisCount)%>（请输入负数）
                            <%: Html.ValidationMessageFor(model => model.DisCount)%>
                        </td>
                        <td width="5px;">
                        </td>
                        <td width="80">
                         <%: Html.LabelFor(model => model.TotalPoint)%>
                        </td>
                        <td>
                             <%: Html.EditorFor(model => model.TotalPoint)%>
                            <%: Html.ValidationMessageFor(model => model.TotalPoint)%>
                        </td>
                        <td width="5px;">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" align="center">
                            <input type="submit" value="保存" class="btn" />
                        </td>
                    </tr>
                </table>
                <table width="100%" border="0" cellspacing="0"  style="display:none;"  id="Content2" cellpadding="3" class="formTable">
                    <tr>
                        <td>
                        商品图片
                        </td>
                         <td>
                        商品名称
                        </td>
                          <td>
                        单价
                        </td>
                         <td>
                        数量
                        </td>
                         <td>
                        积分
                        </td>
                          <td>
                        总额
                        </td>
                    </tr>
                    <% foreach(var item in Model.Order){ %>

                     <tr>
                        <td>
                        <img src='<%=item.Product.ThumbImageUrl %>' />
                        </td>
                         <td>
                        <%=item.ProductName %>
                        </td>
                          <td>
                       <%=item.OrderPrice %>
                        </td>
                         <td>
                         <%=item.OrderNum %>
                        </td>
                         <td>
                         <%=item.OrderNum %>
                        </td>
                         <td>
                            <%=item.TotalSum%>
                        </td>
                    </tr>
                    <%} %>
                    
                </table>
                <% } %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<script type="text/javascript">
    $(document).ready(function () {

        //选项卡按钮
        $('#formTitle').find("div").click(function () {
            var myid = this.id;
            var id = myid.replace('Header', '');
            for (var i = 1; i <= 8; i++) {
                if (i == parseInt(id)) {
                    $('#Header' + i).removeClass().addClass("formTitleCard_c");
                    $('#Content' + i).show();
                }
                else {
                    $('#Header' + i).removeClass().addClass("formTitleCard");
                    $('#Content' + i).hide();
                }
            }
        }); 

    });
    </script>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
